﻿@model RiverCruise.Models.UserManagement.AddUserViewModel

@{
    ViewBag.Title = "New User";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<div class="container-fluid">
    <h2>New User</h2>
    @using (Html.BeginForm("Add", "UserManagement", FormMethod.Post, new { @class = "form-horizontal" }))
    {
        if (!ViewData.ModelState.IsValid)
        {
            <div class="bs-callout bs-callout-danger text-danger ">
                @Html.ValidationSummary()
            </div>
        }

        <div class="form-group">
            @Html.AntiForgeryToken()
            
            @Html.LabelFor(model => model.Name, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.TextBoxFor(model => model.Name, new { @class = "form-control", placeholder = "Name" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.Name)</span>
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.Password, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.PasswordFor(model => model.Password, new { @class = "form-control", placeholder = "Password" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.Password)</span>
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.PasswordConfirm, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.PasswordFor(model => model.PasswordConfirm, new { @class = "form-control", placeholder = "Password" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.PasswordConfirm)</span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                @Html.CheckBoxFor(model => model.CanEdit) Can edit
            </div>
        </div>
        
        <br />
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary form-control">Create</button>
            </div>
        </div>
    }
</div>
